{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<PkiPageHeader @backend={{this.model.engine}} />

{{#if this.model.hasConfig}}
  <Page::PkiConfigurationDetails
    @acme={{this.model.acme}}
    @cluster={{this.model.cluster}}
    @urls={{this.model.urls}}
    @crl={{this.model.crl}}
    @backend={{this.model.engine.id}}
    @canDeleteAllIssuers={{this.model.issuerModel.canDeleteAllIssuers}}
    @hasConfig={{this.model.hasConfig}}
  />
{{else}}
  <Toolbar>
    <ToolbarActions>
      <ToolbarLink @route="configuration.create" @model={{this.model.engine.id}} data-test-configure-pki-button>
        Configure
      </ToolbarLink>
    </ToolbarActions>
  </Toolbar>
  <EmptyState @title="PKI not configured" @message={{this.notConfiguredMessage}}>
    <Hds::Link::Standalone
      @icon="chevron-right"
      @iconPosition="trailing"
      @text="Configure PKI"
      @route="configuration.create"
      @model={{this.model.engine.id}}
    />
  </EmptyState>
{{/if}}

<SecretsEngineMountConfig
  @model={{this.model.mountConfig}}
  class="has-top-margin-m has-bottom-margin-xl"
  data-test-mount-config
/>